<template>
  <el-breadcrumb separator="/">
    <el-breadcrumb-item 
      v-for="(item, index) in breadcrumbList" 
      :key="item.path"
      :to="index === breadcrumbList.length - 1 ? undefined : item.path"
    >
      {{ item.name }}
    </el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script setup>
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { useMenuStore } from '@/stores/menu'

const route = useRoute()
const menuStore = useMenuStore()

// 计算面包屑导航
const breadcrumbList = computed(() => {
  const currentPath = route.path
  return menuStore.getBreadcrumb(currentPath)
})
</script>

<style scoped>
.el-breadcrumb {
  font-size: 14px;
  line-height: 50px;
}
</style>